package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.ClientClaim;
import cn.wolfcode.crm.mapper.ClientClaimMapper;
import cn.wolfcode.crm.query.EmployeeQueryObject;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IClientClaimService;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class ClientClaimServiceImpl implements IClientClaimService {
    @Autowired
    private ClientClaimMapper clientClaimMapper;


    public List<ClientClaim> selectAll() {
        return clientClaimMapper.selectAll();
    }

    public PageResult query(QueryObject qo) {
        int count = clientClaimMapper.query4Count(qo);
        if (count > 0) {
            return new PageResult(count, clientClaimMapper.query4List(qo));
        }
        return new PageResult(count, Collections.EMPTY_LIST);
    }

    public void updateByPrimaryKey(ClientClaim record) {
        clientClaimMapper.updateByPrimaryKey(record);
    }

    public void insert(ClientClaim record) {
        clientClaimMapper.insert(record);
    }

    public ClientClaim selectByPrimaryKey(Long id) {
        return clientClaimMapper.selectByPrimaryKey(id);
    }

    public List<ClientClaim> selectByKeyword(EmployeeQueryObject qo) {
        return clientClaimMapper.selectByKeyword(qo);
    }
}
